package com.weibo4j.api.response.account;

import com.weibo4j.api.WeiboResponse;
import com.weibo4j.api.domain.AccountPrivacy;
import com.weibo4j.api.json.JSON;

public class AccountPrivacyResponse extends WeiboResponse<AccountPrivacy>{

    private AccountPrivacy model;

    @Override
    public AccountPrivacy getModel() {
        if (success && model == null) {
            isSuccess();
        }
        return model;
    }

    @Override
    public boolean isSuccess() {
        boolean isSuccess = super.isSuccess();
        if (isSuccess && model == null) {
            model = JSON.parseObject(jsonString, AccountPrivacy.class);
        }
        return isSuccess;
    }

}
